var obj = {
    name: 'zs'
}
var objProperty = {
    name: 'ls'
}
Object.defineProperty(obj, 'name', { // 注意这里的括号
    get() {
        console.log('劫持属性')
        return objProperty.name
    },
    set(val) {
        console.log('设置劫持属性')
        objProperty.name = val
    }
});
console.log(obj.name)
obj.name = 'ww'
console.log(obj.name)